import request from "@/utils/api/request.js";

export const ListG = (sno, grade) => {
    return request({
        url: '/admin/list-g',
        method: 'get',
        params: {
            sno:sno,
            grade: grade,
        }
    })
};

export const UpdateG = (sno, name, gender, dept, major, grade,
                        phone, graduateDate, password) => {
    return request({
        url: '/admin/update-g',
        method: 'put',
        data: {
            sno: sno,
            name: name,
            gender: gender,
            dept: dept,
            major: major,
            grade: grade,
            phone: phone,
            graduateDate: graduateDate,
            password: password,
        }
    })
};

export const DeleteG = (sno) => {
    return request({
        url: `/admin/del-g/${sno}`,
        method: 'delete',
    })
};

export const ListW = (sno) => {
    return request({
        url: '/admin/list-w',
        method: 'get',
        params:{
            sno:sno,
        }
    })
};

export const SaveW = (sno, name, eno, enterpriseName, major, phone, info) => {
    return request({
        url: '/admin/save-w',
        method: 'post',
        data: {
            sno: sno,
            name: name,
            eno: eno,
            enterpriseName: enterpriseName,
            major: major,
            phone: phone,
            info: info,
        },
    })
};

export const DeleteW = (sno) => {
    return request({
        url: `/admin/del-w/${sno}`,
        method: 'delete',
    })
};

export const ListE = (eno) => {
    return request({
        url: '/admin/list-e',
        method: 'get',
        params:{
            eno:eno,
        }
    })
};

export const SaveE = (eno, enterpriseName, registerNumber, legalRepresentative, password) => {
    return request({
        url: '/admin/save-e',
        method: 'post',
        data: {
            eno: eno,
            enterpriseName: enterpriseName,
            registerNumber: registerNumber,
            legalRepresentative: legalRepresentative,
            password: password,
        },
    })
};

export const DeleteE = (eno) => {
    return request({
        url: '/admin/del-e',
        method: 'delete',
        params: {
            eno: eno,
        }
    })
};

export const ListM = (sno) => {
    return request({
        url: '/admin/list-m',
        method: 'get',
        params:{
            sno:sno,
        }
    })
};

export const DeleteM = (ids) => {
    return request({
        url: '/admin/del-m',
        method: 'delete',
        params: {
            ids: ids.toString(),
        }
    })
};

